package week7;

import java.util.*;


class ArrayUtils{
	static class PairResult{
		private double min;
		private double max;
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
		
		
	}
	public static PairResult findMinMax(double[] values){
		PairResult p = new PairResult();
		p.max = values[0];
		p.min = values[0];
		for(int i=1;i<values.length;i++){
			if(p.max<values[i]){
				p.max = values[i];
			}
			if(p.min>values[i])
				p.min = values[i];
		}
		return p;
	}
}

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in );
		int n = sc.nextInt();
		double[] arr = new double[n];
		for(int i=0;i<n;i++){
			arr[i] = sc.nextDouble();
		}
		ArrayUtils a = new ArrayUtils();
		ArrayUtils.PairResult p = new ArrayUtils.PairResult();
		p=a.findMinMax(arr);
		System.out.println(p.toString());
		System.out.println(ArrayUtils.PairResult.class);

	}

}

